Ext.define('Zm.view.user.Edit',{
    extend:'Ext.window.Window',
    alias:'widget.useredit',
    requires:['Ext.form.Panel'],
    layout:'fit',
    autoShow:true,
    
    initComponent: function(){
        var me = this,
            lang = Zm.i18n.Lang;
        Ext.apply(me,{
            title:lang.tUserEdit,
            items:[{
                xtype:'form',
                bodyStyle:'padding:5px 5px 0',
                fieldDefaults:{
                    labelAlign:'right',
                    labelWidth: 80
                },
                items:[{
                    xtype:'textfield',
                    name:'username',
                    fieldLabel:lang.tLogName,
                    allowBlank:false
                },{
                    xtype:'textfield',
                    name:'passwd',
                    fieldLabel:lang.tPassWd,
                    inputType:'password'
                },{
                    xtype:'textfield',
                    name:'repasswd',
                    fieldLabel:lang.tRePass,
                    inputType:'password'
                },{
                    xtype:'checkboxfield',
                    name:'isadmin',
                    fieldLabel:lang.tIsAdmin,
                    boxLabel:lang.tYes,
                    inputValue:'1'
                },{
                    xtype:'hiddenfield',
                    name:'userid'
                }],
                buttons:[{
                    text:lang.tSave,
                    formBind:true,
                    action:'save'
                },{
                    text:lang.tCancel,
                    handler: function(){
                        me.close();
                    }
                }]
            }]
        });
        me.callParent(arguments);
    }
});